-
Notifications
You must be signed in to change notification settings - Fork 32
♻️🎨 [Frontend] Study Store II #8090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️🎨 [Frontend] Study Store II #8090
Conversation
…into enh/study-store
…into enh/study-store
…into enh/study-store
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors study-related API interactions to use centralized store singletons (osparc.store.Study and osparc.store.Templates), reducing duplicated fetch calls and consolidating state and debt management.
- Introduces
osparc.store.Studywith methods for opening, closing, creating, duplicating, and paying debt for studies, plus events and caching for study state/debt. - Adds
osparc.store.Templates.createTemplateand updates the Resources specification forpostToTemplate. - Replaces direct
osparc.data.Resources.fetchcalls across multiple components and updates corresponding tests and handlers.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| services/static-webserver/client/source/class/osparc/viewer/NodeViewer.js | Switched study open to use osparc.store.Study.openStudy |
| services/static-webserver/client/source/class/osparc/study/Utils.js | Updated createStudyAndPoll to call osparc.store.Study methods |
| services/static-webserver/client/source/class/osparc/study/CreateFunction.js | Replaced template fetch with osparc.store.Templates.createTemplate |
| services/static-webserver/client/source/class/osparc/study/BillingSettings.js | Changed debt payment to use osparc.store.Study.payDebt |
| services/static-webserver/client/source/class/osparc/store/Templates.js | Added createTemplate helper |
| services/static-webserver/client/source/class/osparc/store/Study.js | New singleton with state/debt management and API wrappers |
| services/static-webserver/client/source/class/osparc/store/Store.js | Removed duplicated state/debt logic |
| services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js | Updated close and state polling to use store methods |
| services/static-webserver/client/source/class/osparc/desktop/MainPage.js | Updated template creation and study state polling via stores |
| services/static-webserver/client/source/class/osparc/data/model/Study.js | Modified model’s openStudy to delegate to store.Study |
| services/static-webserver/client/source/class/osparc/data/Resources.js | Moved postToTemplate endpoint under correct section |
| services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js | Switched listeners and invalidation to store.Study |
| services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js | Updated debt lookup to store.Study.getStudyDebt |
Comments suppressed due to low confidence (5)
services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js:631
- The call to
osparc.store.Studyis incorrect. You should useosparc.store.Study.getInstance().getStudyState(pipelineId)without invokingStudyas a function.
osparc.store.Study().getInstance().getStudyState(pipelineId);
services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js:931
closeStudywas moved toosparc.store.Study. Update this call toosparc.store.Study.getInstance().closeStudy(this.getStudy().getUuid()).
osparc.store.Store.getInstance().closeStudy(this.getStudy().getUuid())
services/static-webserver/client/source/class/osparc/desktop/MainPage.js:312
- Incorrect invocation of the Study store. Use
osparc.store.Study.getInstance().getStudyState(studyId)instead of callingStudy().
osparc.store.Study().getInstance().getStudyState(studyId);
services/static-webserver/client/source/class/osparc/desktop/MainPage.js:358
- Incorrect invocation of the Study store. Replace with
osparc.store.Study.getInstance().getStudyState(studyId).
osparc.store.Study().getInstance().getStudyState(studyId);
services/static-webserver/client/source/class/osparc/study/BillingSettings.js:241
- The variable
walletIdis not defined here. You should extract it from thewalletobject returned by__getSelectedWallet(), e.g.,wallet.getWalletId().
osparc.store.Study.getInstance().payDebt(this.__studyData["uuid"], walletId, this.__studyData["debt"])
|
@mergify queue |
🟠 Waiting for conditions to match
|
pcrespov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
sanderegg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
GitHK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|



What do these changes do?
Continuation of #8087
Related issue/s
How to test
Dev-ops